/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gestion;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import operacionesDB.AbstractDB;

/**
 *
 * @author Luis Felipe Gomez
 */
public class DBgestionPrestamo extends AbstractDB {
    private ResultSet rs ;
    private PreparedStatement r ;
    public void buscarPrestamoDB(){
    rs = null ; 
    r = null ; 
    
    
}
    public ResultSet todosPrestamos () {
        try {
           r= (PreparedStatement) this.conn.prepareStatement(" call todosPrestamo");
            
            rs = r.executeQuery(); 
             
            
        } catch (SQLException ex) {
            Logger.getLogger(DBgestionPrestamo.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rs ;
        
    }
    public ResultSet buscarPrestamo (int sbnBuscar ){
        try {
            r=(PreparedStatement) this.conn.prepareStatement("call consultarPrestamo (?)");
            r.setInt(1, sbnBuscar);
            rs= r.executeQuery(); 
            
           
            
        } catch (SQLException ex) {
            Logger.getLogger(DBgestionPrestamo.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
        
        return rs;  
    }
    public static void main ( String [] arga )
    {
        DBgestionPrestamo o = new DBgestionPrestamo () ; 
        o.buscarPrestamo(1);
    }    
    
}
